package com.jwds.digital.bios.business.service.service.belt.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltRouteTaskBeltMainReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.entity.belt.BeltRouteTaskBeltMain;
import com.jwds.digital.bios.business.core.infrastructure.mapper.belt.BeltRouteTaskBeltMainMapper;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltRouteTaskBeltMainRespVO;
import com.jwds.digital.bios.business.service.service.belt.IBeltRouteTaskBeltMainService;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 路线作业实绩主表实现类
 * @author: 秦伟烽
 * @Date: 2024/12/16
 */
@Slf4j
@Service
public class BeltRouteTaskBeltMainImpl extends ServiceImpl<BeltRouteTaskBeltMainMapper, BeltRouteTaskBeltMain> implements IBeltRouteTaskBeltMainService {
    @Override
    public PageResponse<BeltRouteTaskBeltMainRespVO> page(PageRequest<BeltRouteTaskBeltMainReqDTO> request) {
        BeltRouteTaskBeltMainReqDTO condition = request.getQueryCondition();
        Page<BeltRouteTaskBeltMainRespVO> page = new Page<>(request.getPageIndex(), request.getPageSize());
        IPage<BeltRouteTaskBeltMainRespVO> pageData = baseMapper.pageQuery(page, condition);
        return new PageResponse<>((Page<?>) pageData, pageData.getRecords());
    }
}
